home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Amiga Public Domain Connection / APDC Disk #025 - Programming Languages (198x)(Amiga Public Domain Connection)(US)[m][WB].zip / APDC Disk #025 - Programming Languages (198x)(Amiga Public Domain Connection)(US)[m][WB].adf / Modula-2 / m2 / ExecUtil.DEF < prev    next >
Text File  |  1988-03-15  |  2KB  |  52 lines

  1. (********************************************************************************
  2.  
  3. Name         : ExecUtil.DEF
  4. Version      : 1.0
  5. Purpose      : Additional NonLib Functions Provided in the C-Interface to Exec
  6. Author       : ms
  7. Modified     : 5.4.86  17:00 ms
  8. Comments     : Don't know if these are all functions and if their interfaces
  9.                are identical to the C-interfaces.
  10.                AllocString is private function to get nul-terminated strings.
  11. ********************************************************************************)
  12.  
  13. DEFINITION MODULE ExecUtil;
  14.  
  15. FROM Exec   IMPORT MsgPortPtr, IOStdReq;
  16. FROM SYSTEM IMPORT ADDRESS;
  17.  
  18. TYPE IOStdReqPtr = POINTER TO IOStdReq;
  19.  
  20. PROCEDURE AllocString(VAR p: ADDRESS; st: ARRAY OF CHAR);
  21. (* Function: Allocate memory, copy the string and append a nul character.
  22.    Inputs:   st: dynamic array of characters.
  23.    Result:   p: Address of the string, or NIL if string was empty *)
  24.  
  25. PROCEDURE CreatePort(name: ARRAY OF CHAR; priority: INTEGER): MsgPortPtr;
  26. (* Function: Allocate memory for a MsgPort structure,
  27.              initialize and add it to the system's MsgPort-List.
  28.    Inputs:   name: String; priority: [-128..127]
  29.    Result:   pointer to the new MsgPort, or NIL if failed *)
  30.  
  31. PROCEDURE CreateStdIO(msgPort: MsgPortPtr): IOStdReqPtr;
  32. (* Function: Allocate memory  for a IOStdReq structure and init.
  33.    Input:    msgPort: pointer to MsgPort.
  34.    Result:   pointer to the new IOStdReq, or NIL if failed *)
  35.  
  36. PROCEDURE DeallocString(VAR p: ADDRESS);
  37. (* Function: Deallocate string allocated by AllocString.
  38.    Input:    pointer to string, must be allocated by AllocString! 
  39.    Result:   none. *)
  40.  
  41. PROCEDURE DeletePort(VAR msgPort: MsgPortPtr);
  42. (* Function: Deallocate MsgPort allocated by CreatePort.
  43.    Input:    pointer to MsgPort, must be allocated by CreatePort! 
  44.    Result:   none. *)
  45.  
  46. PROCEDURE DeleteStdIO(VAR ioStdReq: IOStdReqPtr);
  47. (* Function: Deallocate IOStdReq allocated by CreateStdIO.
  48.    Input:    pointer to IOStdReq, must be allocated by CreateStdIO! 
  49.    Result:   none. *)
  50.  
  51. END ExecUtil.
  52.